@layout("/common/_curd/_container.html"){

<script type="text/javascript">
    var ctx = "${basePath}";
    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";

    $(function(){
        initGrid();
        initMenuBtn("btns", "${code}");
    });

    function initGrid(){
        var grid_url = ctx + "/buy/checkli"
        console.log(grid_url)
        var _colnames = ["主键",
            "供应商",
            "商品",
//						"审核状态",
            "数量",
            "规格",
            "预估价格"
        ];
        var _colmodel = [{name:"id", index:"id", hidden:true,width:100},
            {name:"sname", index:"sname", width:100},
            {name:"pname", index:"pname", width:100},
//						{name:"status", index:"status", width:100,formatter:function (value, row, index) {
//							if(value === 1){
//								return "已提交";
//							}else if(value ===2){
//								return "审核已通过";
//							}else if(value ===3){
//								return "审核未通过";
//							}
//						}},
            {name:"num", index:"num", width:100},
            {name:"unit", index:"unit", width:100},
            {name:"pmoney", index:"pmoney", width:100}

        ];

        jQuery(grid_selector).jqGrid({
            url : grid_url,
            shrinkToFit : true,
            colNames : _colnames,
            colModel : _colmodel,
            jsonReader : {id :"id"},
            pager : pager_selector,
            postData : {sort : "id",
                id:'${id!}',
                order : "desc"}
        });
    }

    details = function (id,dept) {
        layer.open({
            type: 2,
            title: '备货详情',
            shadeClose: true,
            area: ['90%', '90%'],
            content: '/buynum/beihuodetail?id='+id+'&&did=' + dept//iframe的url
            ,end:function () {
                $('#quantity').focus()
            }
        })
    }
</script>


<!-- 配置 grid -->
<div class="row">
    <div class="col-xs-12 tb-grid">
        <!-- 配置 查询 -->
        <!-- 按钮 -->
        <!--<div class="welljq well-sm" id="btns"></div>-->
        <!-- grid -->
        <table id="grid-table"></table>
        <!-- 分页-->
        <div id="grid-pager"></div>
    </div>
</div>

<!-- 引入所需的js -->
@include("/common/_listscript.html"){}

@}